<!---load tinymce--->
<cfoutput>
<script type="text/javascript">
	$(document).ready(function() {
		$('textarea.tinymce').tinymce({
			// Location of TinyMCE script
			script_url : '#request.absolutepath#js/tinymce/tiny_mce.js',
			relative_urls : false,
			verify_html : false,
			remove_script_host : true,
			mode : 'exact',
			// General options
			theme : "advanced",
			plugins : "contextmenu,autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,advlist,tinyautosave",

			// Theme options
			theme_advanced_buttons1 : 
"save,tinyautosave,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontsizeselect,forecolor,backcolor,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink,image,media,table,code,|,pastetext,pasteword,|,fullscreen",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons3 : "",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : false,

			// Example content CSS (should be your site CSS)
			content_css : "#request.absolutepath#themes/#request.site_theme#/css/tinymce.css",
			file_browser_callback : 'myFileBrowser',
			accessibility_warnings : false,
    		accessibility_focus : false
		});
	});
</script>

<script type="text/javascript">
	$(document).ready(function() {
		$('textarea.tinymce_advanced').tinymce({
			// Location of TinyMCE script
			script_url : '#request.absolutepath#js/tinymce/tiny_mce.js',
			relative_urls : false,
			verify_html : false,
			remove_script_host : true,
			// General options
			theme : "advanced",
			theme_advanced_resizing : false,
			plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,advlist,tinyautosave",

			// Theme options
			theme_advanced_buttons1 : "save,tinyautosave|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,|,forecolor,backcolor",
			theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,iespell,media,advhr,|,ltr,rtl,|,fullscreen,|,visualchars,nonbreaking,pagebreak",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : true,

			// Example content CSS (should be your site CSS)
			content_css : "#request.absolutepath#css/pagelayouts.css,#request.absolutepath#themes/#request.site_theme#/css/tinymce.css",
			file_browser_callback : 'myFileBrowser',
			accessibility_warnings : false,
    		accessibility_focus : false
		});
	});

/*TinyMCE integration (file browser) */
function myFileBrowser (field_name, url, type, win) {

// alert("Field_Name: " + field_name + "nURL: " + url + "nType: " + type + "nWin: " + win); // debug/testing

var cmsURL = '#request.absoluteadminpath#dialogs/filebrowser/browse.cfm';    // script URL - use an absolute path!
if (cmsURL.indexOf("?") < 0) {
	//add the type as the only query parameter
	cmsURL = cmsURL + "?type=" + type;
}
else {
	//add the type as an additional query parameter
	// (PHP session ID is now included if there is one at all)
	cmsURL = cmsURL + "&type=" + type;
}

tinyMCE.activeEditor.windowManager.open({
	file : cmsURL,
	title : 'Browser',
	width : 855,  // Your dimensions may differ - toy around with them!
	height : 450,
	resizable : "yes",
	inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
	close_previous : "no",
	popup_css : false // Disable TinyMCE's default popup CSS	
}, {
	window : win,
	input : field_name
});
return false;
}
</script>
</cfoutput>
